﻿using Microsoft.Phone.BackgroundTransfer;
using DBDataContext.Model;

public struct DownloadAction
{
    private BackgroundTransferRequest _request;
    public BackgroundTransferRequest Request
    {
        get
        {
            return _request;
        }
        set
        {
            if (value != null)
                _request = value;
        }
    }


    private Chapter _chapter;
    public Chapter Chapter
    {
        get
        {
            return _chapter;
        }
        set
        {
            _chapter = new Chapter();
            SetValueForChapter(value);
        }
    }

    private int _indexFromListBox;
    public int IndexFromListBox
    {
        get
        {
            return _indexFromListBox;
        }
        set
        {
            _indexFromListBox = value;
        }
    }

    public void SetValueForChapter(Chapter value)
    {
        if (value != null)
        {
            _chapter._mangaId = value._mangaId;
            _chapter.ChapterId = value.ChapterId;
            _chapter.ChapterFileLink = value.ChapterFileLink;
            _chapter.ChapterFileName = value.ChapterFileName;
            _chapter.ChapterName = value.ChapterName;
        }
    }
};